package create.singleton;

/**
 * @author dali
 * @date 2021-07-06 14:42
 * @Description 枚举类
 */

public class Enum {
    public static void main(String[] args) {
        instance instance1 = create.singleton.instance.INSTANCE;
        instance instance2 = create.singleton.instance.INSTANCE;
        System.out.println(instance1 == instance2);
        instance1.say();
    }
}

enum instance {
    INSTANCE;
    public void say() {
        System.out.println("ok");
    }
}
